package com.tycmc.signelectroniccontracts.tools.base;

import android.app.Application;

import com.baidu.ocr.sdk.OCR;
import com.baidu.ocr.sdk.OnResultListener;
import com.baidu.ocr.sdk.exception.OCRError;
import com.baidu.ocr.sdk.model.AccessToken;
import com.tycmc.signelectroniccontracts.tools.images.ImageSetting;
import com.tycmc.signelectroniccontracts.tools.images.UrlPath;
import com.tycmc.signelectroniccontracts.tools.show.LogShow;


/**
 * Created by gaoyong on 2017/12/12.
 */

public class BaseApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        ImageSetting.init(this);
        OCR.getInstance(this).initAccessToken(new OnResultListener<AccessToken>() {
            @Override
            public void onResult(AccessToken result) {
                // 调用成功，返回AccessToken对象
                String token = result.getAccessToken();
                LogShow.i("百度初始化成功");
            }

            @Override
            public void onError(OCRError error) {
                LogShow.i("百度初始化失败"+error.getMessage());
                // 调用失败，返回OCRError子类SDKError对象
            }
        }, getApplicationContext());
    }
}
